home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Freelog 55
/
Freelog055.iso
/
Bas
/
Screen-Saver
/
Tocs
/
tocs.exe
/
Movie.swf
/
scripts
/
DefineSprite_20
/
frame_1
/
PlaceObject2_19_1
/
CLIPACTIONRECORD onClipEvent(load).as
< prev
Wrap
Text File
|
2002-02-25
|
2KB
|
79 lines
onClipEvent(load){
function getFirstWeekDay(year, month, day, weekday)
{
tmp = new date(year,month,day);
tmp.setDate(day + (7 + weekday - tmp.getday()) % 7);
return tmp.getTime();
}
function getlastWeekDay(year, month, day, weekday)
{
tmp = new date(year,month,day);
tmp.setDate(day - (7 - weekday + tmp.getday()) % 7);
return tmp.getTime();
}
function getmonthLength(yr, month)
{
nm = month + 1;
ny = yr;
if(month == 11)
{
ny++;
nm = 0;
}
nw = new date(ny,nm,1);
ow = new date(yr,month,1);
return (nw.getday() - ow.getday() + 7) % 7 + 28;
}
curTime = new date();
shColor = new color(secondHand);
clp = new color(frame);
if(_parent.frameColor != "#-1")
{
clp.setRGB(parseInt("0x" + _parent.frameColor.substr(1)));
}
tz = _parent.timeZone;
if(0 < _parent.dayLight)
{
curYear = curTime.getFullYear();
if(_parent.bgdth == 0)
{
tmp = new date(curYear,_parent.bgmt,_parent.bgdt,0,0,0);
beginTime = tmp.getTime();
}
else if(_parent.bgdth == 1)
{
beginTime = getFirstWeekDay(curYear,_parent.bgmt,_parent.bgdt,_parent.bgd);
}
else
{
beginTime = getlastWeekDay(curYear,_parent.bgmt,getMonthLength(curYear,_parent.bgmt),_parent.bgd);
}
if(_parent.enddth == 0)
{
tmp = new date(curYear,_parent.endmt,_parent.enddt,23,59,59);
endTime = tmp.getTime();
}
else if(_parent.enddth == 1)
{
endTime = getFirstWeekDay(curYear,_parent.endmt,_parent.enddt,_parent.endd);
}
else
{
endTime = getlastWeekDay(curYear,_parent.endmt,getMonthLength(curYear,_parent.endmt),_parent.endd);
}
if(_parent.endmt < _parent.bgmt)
{
if(curTime.getTime() >= beginTime or endTime >= curTime.getTime())
{
tz += _parent.dayLight;
}
}
else if(curTime.getTime() >= beginTime and endTime >= curTime.getTime())
{
tz += _parent.dayLight;
}
}
zoneHours = 0 >= tz / 60 ? math.ceil(tz / 60) : math.floor(tz / 60);
zoneMinutes = tz % 60;
}